package cc.rboot.convert.core;

import cc.rboot.convert.helper.ConvertHelper;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;

public interface Convertable {
    default <T, S> T convert(S object) {
        return ConvertHelper.convert((T) this, object);
    }

    default <T, S> IPage<T> convert(IPage<S> page) {
        return ConvertHelper.convert((T) this, page);
    }

    default <T, S> List<T> convert(List<S> page) {
        return ConvertHelper.convert((T) this, page);
    }
}
